package com.yeyv.net.Web.Service.Implement;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeyv.net.Web.Entity.AccountEntity;
import com.yeyv.net.Web.Mapper.AccountMapper;
import com.yeyv.net.Web.Service.AccountService;
import org.springframework.stereotype.Service;

@Service
public class AccountImpl extends ServiceImpl<AccountMapper, AccountEntity> implements AccountService {
    @Override
    public AccountEntity getAccount(String account) {
        return this.getOne(new LambdaQueryWrapper<AccountEntity>()
                .eq(AccountEntity::getAccount,account));
    }

    @Override
    public AccountEntity getAccount(String account, String password) {
        return this.getOne(new LambdaQueryWrapper<AccountEntity>()
                .eq(AccountEntity::getAccount,account)
                .eq(AccountEntity::getPassword,password));
    }
}
